import request from '@/utils/request'

export function listUser(params) {
  return request({
    url: '/system/users',
    method: 'get',
    params: params
  })
}

export function saveUser(data) {
  return request({
    url: '/system/users',
    method: 'post',
    data: data
  })
}

export function updateStatus(data) {
  return request({
    url: '/system/users/status',
    method: 'post',
    data: data
  })
}

export function delUser(id) {
  return request({
    url: '/system/users/' + id,
    method: 'delete'
  })
}

export function getRoleByAdmin(id) {
  return request({
    url: '/admin/role/' + id,
    method: 'get'
  })
}

export function allocRole(data) {
  return request({
    url: '/system/users/roles',
    method: 'post',
    data: data
  })
}

export function listRoles() {
  return request({
    url: '/system/roles/list',
    method: 'get'
  })
}

